---------------------------
-- 贝塞尔曲线
---------------------------
local M = {}

-- 目前只支持三个点
function M:newBezier(params)
	local tPoints = params.tPoints

	local point1 = tPoints[1]
	local point2 = tPoints[2]
	local point3 = tPoints[3]

	local tRecoder = {}
	for t = 0.01, 1.01, 0.01 do
		local newPoint = ((1 - t)^2)*point1 + 2*t*(1 - t)*point2 + t^2*point3
		tRecoder[#tRecoder + 1] = newPoint
	end

	return tRecoder
end

return M